FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 12300-22300


FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /source
ADD ./src/ .

WORKDIR /source/NSmartProxy.ServerHost
RUN dotnet restore NSmartProxy.ServerHost.csproj
RUN dotnet build NSmartProxy.ServerHost.csproj -c Release -o /app/build
RUN dotnet publish NSmartProxy.ServerHost.csproj -c Release -o /app/publish

#need combile 1st.
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
RUN ls -a
RUN ls /app/
ENTRYPOINT ["dotnet", "/app/NSmartProxy.ServerHost.dll"]